package org.example;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

public class SonString extends Father<String>{
    public SonString() {
        super();
        System.out.println("进入子类SonString构造-----注意这里的this是----"+this);

        Class<? extends SonString> aClass = this.getClass();
        Type type = aClass.getGenericSuperclass();
        System.out.println("type is "+type );
        System.out.println("type instanceof ParameterizedType----"+(type instanceof ParameterizedType) );

        Type[] genericInterfaces = aClass.getGenericInterfaces();
        System.out.println(genericInterfaces.length);
        for (Type genericInterface : genericInterfaces) {
            if (genericInterface instanceof ParameterizedType) {
                System.out.println(genericInterface);
            }
        }
    }
}
